home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Mac OS USB DDK_v1.0.1 / Tools / USBDDKMPWMenu < prev   
Encoding:
Text File  |  1998-09-03  |  6.8 KB  |  151 lines  |  [TEXT/MPS ]

  1. #
  2. #    File:        BuildUSBMenu
  3. #
  4. #    Contains:    xxx put contents here xxx
  5. #
  6. #    Version:    xxx put version here xxx
  7. #
  8. #    Copyright:    © 1997-1998 by Apple Computer, Inc., all rights reserved.
  9. #
  10.  
  11. set echo 0
  12.  
  13. Set -e USBDDKObjects "{USBDDKFolder}Objects:";
  14. Set -e USBDDKTargets "{USBDDKFolder}Targets:";
  15. Set -e USBDDKReleaseExtensions "{USBDDKFolder}Extensions-DDKBuilt:";
  16. Set -e USBDDKMapDir "{USBDDKFolder}Targets:Maps:"
  17.  
  18. Set -e USBDDKDrivers "{USBDDKFolder}Drivers:";
  19. Set -e USBDDKExamples "{USBDDKFolder}Examples:";
  20. Set -e USBDDKInterfaces "{USBDDKFolder}Interfaces:";
  21. Set -e USBDDKRIncludes "{USBDDKFolder}Interfaces:";
  22. Set -e USBDDKLibraries "{USBDDKFolder}Libraries:";
  23.  
  24. Set -e USBDDKInterfacesExternal "{CIncludes}";
  25. Set -e USBDDKInterfacesInternal "{USBDDKFolder}Interfaces:";
  26.  
  27. # •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  28. # Add the USBDDK menu with its associated items.
  29. Set USBDDKProjectMenuName USBDDK;                                    # USBDDK is the name of the menu
  30.  
  31. DeleteMenu "{USBDDKProjectMenuName}" ∑ dev:null || Echo ∑ dev:null            
  32.  
  33.  
  34. # ••••• Set Build mode (Engineering or SCM):
  35. #
  36. Alias SetBuildMenus 'If {USBDDKEngrBuild} ;                                                             ∂
  37.     AddMenu "USBDDK" "Engineering Build!√" "Set -e USBDDKEngrBuild 1; SetBuildMenus" ;                 ∂
  38.     AddMenu "USBDDK" "SCM Build" "Set -e USBDDKEngrBuild 0 ; SetBuildMenus" ;                         ∂
  39.   Else;                                                                                                     ∂
  40.     Set -e USBDDKSymbols "-sym off";                                                                     ∂
  41.     Set -e USBDDKMBGSymbols "-mbg off";                                                                 ∂
  42.     Set -e USBDDKDebugFlag 0;                                                                             ∂
  43.     Set -e DebugBuild 0;                                                                                     ∂
  44.     AddMenu "USBDDK" "Engineering Build" "Set -e USBDDKEngrBuild 1; SetBuildMenus" ;                 ∂
  45.     AddMenu "USBDDK" "SCM Build!√" "Set -e USBDDKEngrBuild 0; SetBuildMenus" ;                         ∂
  46.   End;'
  47.  
  48. SetBuildMenus;
  49.  
  50. AddMenu "{USBDDKProjectMenuName}" '(-' ''
  51.  
  52. # ••••• Does the basic build.
  53. #
  54. AddMenu "{USBDDKProjectMenuName}" 'Build Driver or Example/ç' 'Open "{Worksheet}"; "{USBDDKToolsFolder}"USBDDKBuildDriver ∑∑ "{Worksheet}"'
  55.  
  56.  
  57. # ••••• Does the basic full build by specifying the -e delimeter to the make function.
  58. # Warning!  This is dangerous because if a source file fails to assemble/compile, there still might be a corresponding 
  59. # old object file hanging around which would get linked in as if there was no problem... - DMS
  60. # AddMenu "{USBDDKProjectMenuName}" 'Full Build Driver or Example/ƒ' 'Open "{Worksheet}"; "{USBDDKToolsFolder}"USBDDKBuildDriver full ∑∑ "{Worksheet}"'
  61.  
  62.  
  63. # ••••• Deletes all the objects of the current driver as per its makefile - then does a full rebuild.
  64. #
  65. AddMenu "{USBDDKProjectMenuName}" 'Clean & Rebuild Driver or Example…' 'Open "{Worksheet}"; ∂
  66.                                                                 Confirm "Delete object files and rebuild?" || (Beep; Exit); ∂
  67.                                                                 "{USBDDKToolsFolder}"USBDDKBuildDriver clean ∑∑ "{Worksheet}"'
  68.  
  69. # ••••• Toggles the USBDDKSymbols variable to turn debugger symbols on or off
  70. #
  71. AddMenu "{USBDDKProjectMenuName}" 'Debug Symbols & Flags…'    'if "{USBDDKSymbols}" == "-sym on"; ∂
  72.                                                                 Confirm "Symbols and Flags are currently on. Turn all symbols off?" || (Beep; Exit); ∂
  73.                                                                 Set -e USBDDKSymbols "-sym off"; ∂
  74.                                                                 Set -e USBDDKMBGSymbols "-mbg off"; ∂
  75.                                                                 Set -e USBDDKDebugFlag 0; ∂
  76.                                                                 Set -e DebugBuild 0; ∂
  77.                                                             Else; ∂
  78.                                                                 Confirm "Symbols and Flags are currently off. Turn all symbols on?" || (Beep; Exit); ∂
  79.                                                                 Set -e USBDDKSymbols "-sym on"; ∂
  80.                                                                 Set -e USBDDKMBGSymbols "-mbg on"; ∂
  81.                                                                 Set -e USBDDKDebugFlag 1; ∂
  82.                                                                 Set -e DebugBuild 1; ∂
  83.                                                             End; ∂
  84.                                                             Echo "#  USBDDKSymbols = "{USBDDKSymbols} ∑∑ "{Worksheet}"; ∂
  85.                                                             Echo "#  USBDDKMBGSymbols = "{USBDDKMBGSymbols} ∑∑ "{Worksheet}"; ∂
  86.                                                             Echo "#  USBDDKDebugFlag = "{USBDDKDebugFlag} ∑∑ "{Worksheet}"; ';
  87.  
  88.  
  89.  
  90. AddMenu "{USBDDKProjectMenuName}" "(-" "";
  91.  
  92.  
  93. # ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  94. # This for loop puts all of the drivers directories in the USBDDK menu.
  95. # When the driver name is selected in the menu, the current directory is set to where that folder currently exists.
  96. # The UserStartup script is executed again to get the proper menu un-checked and checked. 
  97. #
  98. #echo "Add select driver"
  99. set foldersfound 0
  100. AddMenu "{USBDDKProjectMenuName}" 'Select Driver in DriverSrc Folder' '';
  101. if `Exists "{USBDDKFolder}DriverSrc"`
  102.     For i In `Files -af -f -d "{USBDDKFolder}DriverSrc"`                        # For all directories in Sources folder....
  103.         (Evaluate "{i}" =~ /≈':'≈':'(≈)®1':'/) ∑ dev:null                        # Get the name of the folder, put in ®1
  104.         Set char ''                                                                # else make sure there is no checkmark.
  105.         AddMenu "DDKDriverList" "{®1}{char}"   "(Directory ∂"{i}∂") ∑∑ ∂""{Worksheet}"∂" ; set -e USBDDKDriverPath {i};  set -e USBDDKDriver {®1}";    
  106.         set foldersfound '1'
  107.     End
  108.     if {foldersfound} == '1'
  109.         AddMenu -link "{USBDDKProjectMenuName}" 'Select Driver in DriverSrc Folder' 'DDKDriverList';
  110.     End
  111. End
  112.  
  113. #echo "Add select example"
  114. set foldersfound 0
  115. AddMenu "{USBDDKProjectMenuName}" 'Select Example' '';
  116. if `Exists "{USBDDKFolder}Examples"`
  117.     For i In `Files -af -f -d "{USBDDKFolder}Examples"`                        # For all directories in Examples folder....
  118.         (Evaluate "{i}" =~ /≈':'≈':'(≈)®1':'/) ∑ dev:null                        # Get the name of the folder, put in ®1
  119.         Set char ''                                                                # else make sure there is no checkmark.
  120.         AddMenu "ExampleList" "{®1}{char}" "(Directory ∂"{i}∂") ∑∑ ∂""{Worksheet}"∂" ; set -e USBDDKDriverPath {i};  set -e USBDDKDriver {®1}";    
  121.         set foldersfound '1'
  122.     End
  123.     if {foldersfound} == '1'
  124.         AddMenu -link "{USBDDKProjectMenuName}" 'Select Example' 'ExampleList';
  125.     End
  126. End
  127.  
  128. #echo "Add create driver menu item"
  129. AddMenu "{USBDDKProjectMenuName}" '(-' '';
  130. AddMenu "{USBDDKProjectMenuName}" 'Create New Driver in DriverSrc folder…' 'Open "{Worksheet}"; ∂
  131.         Set NewDriverName "`(Request "What is the name of the new driver?")≥dev:null`"; ∂
  132.         if ¬ `Exists "{USBDDKFolder}DriverSrc:""{NewDriverName}"`; ∂
  133.             NewFolder "{USBDDKFolder}DriverSrc:""{NewDriverName}"; ∂
  134.         End;  ∂
  135.         Execute "{USBDDKToolsFolder}USBDDKMPWMenu"; '
  136.  
  137. #echo "Add build menu items"
  138. AddMenu "{USBDDKProjectMenuName}" '(-' '';
  139. AddMenu "{USBDDKProjectMenuName}" 'Build All USB Drivers and examples…' 'Open "{Worksheet}"; ∂
  140.                                                             directory "{USBDDKFolder}{USBDDKLocalFolder}"; ∂
  141.                                                              "{USBDDKToolsFolder}"USBDDKBuildAll ∑∑ "{Worksheet}";'
  142.  
  143. AddMenu "{USBDDKProjectMenuName}" 'Clean & Build All USB Drivers and examples…' 'Open "{Worksheet}"; ∂
  144.                                                             directory "{USBDDKFolder}{USBDDKLocalFolder}"; ∂
  145.                                                              "{USBDDKToolsFolder}"USBDDKBuildAll clean ∑∑ "{Worksheet}";'
  146.  
  147. AddMenu "{USBDDKProjectMenuName}" 'Full Build All USB Drivers and examples…'     'Open "{Worksheet}"; ∂
  148.                                                             Confirm "FULL Build of all USB Drivers?∂n" || (Beep; Exit); ∂
  149.                                                             directory "{USBDDKFolder}{USBDDKLocalFolder}"; ∂
  150.                                                             "{USBDDKToolsFolder}"USBDDKBuildAll full ∑∑ "{Worksheet}";'
  151.